﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Bootstrap5.Abstractions;

using Microsoft.AspNetCore.Components;

namespace Bootstrap5;

[HtmlTag("span")]
[CssClass("badge")]
public class Badge : BootstrapComponentBase, IHasChildContent
{
    public Badge()
    {

    }

    [Parameter][CssClass("bg-")] public Color Color { get; set; } = Color.Primary;

    [Parameter][CssClass("rounded-pill")]public bool Pill { get; set; }

    [Parameter] public RenderFragment ChildContent { get; set; }

    protected override void CreateCssClass(ICssClassBuilder builder)
    {
        builder.Add("text-dark", new[] { Color.Warning, Color.Light,Color.Info }.Contains(Color));
    }
}
